<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateProjectsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('projects', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->default('')->comment('名称');
            $table->string('amount')->default('0')->nullable()->comment('成交金额');
            $table->string('prouser')->default('')->comment('项目负责人');
            $table->string('user_id')->default('')->comment('销售代表');
            $table->string('budget')->default('0')->nullable()->comment('客户预算');
            $table->string('customer_id')->default('')->comment('客户');
            $table->string('status')->default('0')->nullable()->comment('状态');
            $table->string('schedule')->default('0')->nullable()->comment('进度');
            $table->string('technical_staff')->nullable()->comment('技术人员');
            $table->string('source')->nullable()->comment('来源');
            $table->integer('construction_period')->default('0')->nullable()->comment('工期');
            $table->integer('balance_payment')->default('0')->nullable()->comment('尾款');
            $table->integer('project_cost')->default('0')->nullable()->comment('项目成本');
            $table->integer('gross_profit')->default('0')->nullable()->comment('毛利润');
            $table->string('contract_no')->nullable()->comment('合同编号');
            $table->text('remark')->nullable()->comment('备注');
            $table->string('admin_id')->nullable()->comment('创建人');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('projects');
    }
}
